﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Alos.Entity;
using Alos.Common;
using Alos.IRepository;
using Alos.IService;

namespace Alos.Service
{
    public class ReTeachRecordService : BaseService<ReTeachRecord>, IReTeachRecordService
    {
       IReTeachRecordRepository ReTeachRecordRepository;
       public ReTeachRecordService(IReTeachRecordRepository _ReTeachRecordRepository)
        {
            ReTeachRecordRepository = _ReTeachRecordRepository;
        }

        /// <summary>
        /// 添加教师上课记录
        /// </summary>
        public int CreateReTeachRecord(ReTeachRecord ReTeachRecord)
        {
            return ReTeachRecordRepository.CreateReTeachRecord(ReTeachRecord);
        }
        /// <summary>
        /// 修改教师上课记录
        /// </summary>
        public int UpdateReTeachRecord(int id)
        {
            return ReTeachRecordRepository.UpdateReTeachRecord(id);
        }
        /// <summary>
        /// 检查上一堂课是否正常结束
        /// </summary>
        public ReTeachRecord getReTeachRecord(int id, int ClassId)
        {
            return ReTeachRecordRepository.getReTeachRecord(id,ClassId);
        }
        /// <summary>
        /// 获取最近一条上课记录
        /// </summary>
        /// <returns>ReTeachRecord</returns>
        public ReTeachRecord GetReTeachRecord()
        {
            return ReTeachRecordRepository.GetReTeachRecord();
        } 
         /// <summary>
        /// 点击下课
        /// </summary>
        public IEnumerable<dynamic> EndReTeachRecord(int TeacherID, int LessionID)
        {
            return ReTeachRecordRepository.EndReTeachRecord(TeacherID,LessionID);
        }
        /// <summary>
        /// 学生登录后  等待老师准备上课
        /// </summary>
        /// <param name="classId">班级编号</param>
        /// <returns></returns>
        public dynamic isBeginTeach(int classId) {
            return ReTeachRecordRepository.isBeginTeach(classId);
        }


        public int EndPreTeachRecord(int ID)
        {
            return ReTeachRecordRepository.EndPreTeachRecord(ID);
        }
    }
}
